package org.example.base;

import java.util.ArrayList;

public class HashTest {
    public static void main(String[] args) {
        HashTest hashTest = new HashTest("a");
        HashTest hashTest2 = new HashTest("b");

        System.out.println(hashTest.hashCode());
        System.out.println(hashTest2.hashCode());

        System.out.println(hashTest.equals(hashTest2));

    }

    private String name;
    public HashTest() {}
    public HashTest(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof HashTest) {
            HashTest hashTest = (HashTest) obj;
            return hashTest.name.equals(this.name) || hashTest.name.equals("b");
        }

        return false;
    }
}
